package com.tao.lab

import kotlinx.coroutines.*
import org.junit.Test

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * See [testing documentation](http://d.android.com/tools/testing).
 */
class ExampleUnitTest {
    @Test
    fun addition_isCorrect() {
        var arrs = arrayOf(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0)
        GlobalScope.launch() {

            arrs.forEach {
                var index = printMsg(it);
                print("当前序号：$index")
            }

        }

    }


    suspend fun printMsg(index: Int) = withContext(Dispatchers.IO) {
        delay(100)
        index
    }

}